/* 
 * File:   ipd_filter.h
 * Author: dima
 *
 * Created on 27 января 2015 г., 23:06
 */

#ifndef IPD_FILTER_H
#define	IPD_FILTER_H
#include "ipd_img.h"
namespace ipd
{

class ipd_filter
{
public:
    ipd_filter(ipd_img &img);
    virtual ~ipd_filter();
    virtual void init(int w_mask, int h_mask, int *maska); //object initialization
    virtual void convert_image(ipd_img &img); //convert Image
protected:
    virtual void multiply(double mask, unsigned char *pixel); //multiply the pixel on the mask weights
    virtual void get_pixel(unsigned char *pixel); //get normalized pixel
    ipd_filter(const ipd_filter& orig);
    int width_image;
    int height_image;
    int width_mask; //width mask
    int height_mask; //height mask
    color_model img_model; //model image
    ipd_img &original_image; //original image
    int *mask; // mask
    unsigned char* pixel;
    int *sum; // sum+=pixel[i]*mask[i]
    int sum_elements_mask; //sum of the elements in the mask
private:
    void delete_mask(); // delete mask

};
}
#endif	/* IPD_FILTER_H */

